[Unit]
Description=openGauss
Documentation=openGauss Server
After=syslog.target
After=network.target

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
User={{ opengauss_user }}
Group={{ opengauss_group }}
Environment=PGDATA={{ gausshome }}/data/{{ opengauss_port }}
Environment=GAUSSHOME={{ gausshome }}
Environment=LD_LIBRARY_PATH={{ gausshome }}/lib
ExecStart={{ gausshome }}/bin/gaussdb
ExecReload=/bin/kill -HUP $MAINPID
KillMode=mixed
KillSignal=SIGINT
TimeoutSec=0
{% if fcs_opengauss_use_jemalloc == 1 %}
{% if os_type in ['openEuler22','openEuler20'] %}
Environment="LD_PRELOAD=/usr/lib64/libjemalloc.so.2"
{% else %}
Environment="LD_PRELOAD=/usr/lib64/libjemalloc.so.1"
{% endif %}
{% endif %}
